//
//  PayMoneyManagerContentTableViewCell.m
//  PropertyManager
//
//  Created by TNG on 2018/7/18.
//  Copyright © 2018年 Tng. All rights reserved.
//

#import "PayMoneyManagerContentTableViewCell.h"

@implementation PayMoneyManagerContentTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creatUI];
        self.backgroundColor = SFMNavBarColor;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

-(void)creatUI{
    [self.contentView addSubview:self.bgView];
    [self.bgView addSubview:self.userImg];
    [self.bgView addSubview:self.userLabel];
    [self.bgView addSubview:self.companyImg];
    [self.bgView addSubview:self.companyLabel];
}

-(UIView *)bgView
{
    if (_bgView == nil) {
        _bgView = [[UIView alloc] initWithFrame:CGRectMake(25, 0, WIDTH - 50, 373)];
        _bgView.backgroundColor = SFMWhiteColor;
        _bgView.layer.cornerRadius = 5;
        _bgView.clipsToBounds = YES;
    }
    return _bgView;
}

-(UIImageView *)userImg
{
    if (_userImg == nil) {
        _userImg = [[UIImageView alloc] initWithFrame:CGRectMake(WIDTH/2 - 60, 53, 70, 70)];
        _userImg.contentMode = UIViewContentModeScaleAspectFit;
        _userImg.image = [UIImage imageNamed:@"PayMoneyManagerUser"];
        _userImg.layer.cornerRadius = 35;
        _userImg.clipsToBounds = YES;
        _userImg.layer.borderColor = SFMNavBarColor.CGColor;
        _userImg.layer.borderWidth = 1;
    }
    return _userImg;
}

-(UILabel *)userLabel
{
    if (_userLabel == nil) {
        _userLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.userImg.frame) + 6, WIDTH - 50, 20)];
        _userLabel.font = font(18);
        _userLabel.textColor = SFMColor(246, 110, 36);
        _userLabel.textAlignment = NSTextAlignmentCenter;
        _userLabel.text = @"个人账户";
    }
    return _userLabel;
}

-(UIImageView *)companyImg
{
    if (_companyImg == nil) {
        _companyImg = [[UIImageView alloc] initWithFrame:CGRectMake(WIDTH/2 - 60, 219, 70, 70)];
        _companyImg.contentMode = UIViewContentModeScaleAspectFit;
        _companyImg.image = [UIImage imageNamed:@"PayMoneyManagerNoSelectCompany"];
        _companyImg.layer.cornerRadius = 35;
        _companyImg.clipsToBounds = YES;
        _companyImg.layer.borderColor = SFM153.CGColor;
        _companyImg.layer.borderWidth = 1;
    }
    return _companyImg;
}

-(UILabel *)companyLabel
{
    if (_companyLabel == nil) {
        _companyLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.companyImg.frame) + 6, WIDTH - 50, 20)];
        _companyLabel.font = font(18);
        _companyLabel.textColor = SFM153;
        _companyLabel.textAlignment = NSTextAlignmentCenter;
        _companyLabel.text = @"企业账户";
    }
    return _companyLabel;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
